﻿using System;
using System.Windows.Forms;
using System.Drawing;

namespace WinControls
{
    /// <summary>
    /// Replacement for MessageBox class.
    /// </summary>
    /// <remarks>
    /// This dialog centers itself over owning form and displays a supplied icon.
    /// </remarks>
    public static class WinMessageBox
    {
        public static void Show (Icon boxIcon, string message, string caption)
        {
            using (var box = new MessageDialog (boxIcon, message, caption, MessageBoxButtons.OK))
            {
                box.ShowDialog();
            }
        }


        public static DialogResult Show (Icon boxIcon, string message, string caption, MessageBoxButtons buttons)
        {
            DialogResult result = DialogResult.None;

            using (var box = new MessageDialog (boxIcon, message, caption, buttons))
            {
                //box.Focus();
                result = box.ShowDialog ();
            }

            return result;
        }
    }
}
